home *** CD-ROM | disk | FTP | other *** search
/ Educational Software Cooperative 4 / Educational Software Cooperative 4.iso / hurkle / hurkle2.doc < prev    next >
Text File  |  1994-06-27  |  2KB  |  52 lines

  1.  
  2.  
  3.  
  4.                                     HURKLE
  5.                                  Version  2.2
  6.                                 Copyright 1993
  7.  
  8.                         CASTLE OAKS COMPUTER SERVICES
  9.                             Post Office Box 36082
  10.                          Indianapolis, IN 46236-0082
  11.  
  12.  
  13. Don't read any further if you want to keep playing HURKLE as a game.  Or 
  14. perhaps you may want to read on but withhold this information from friends.
  15.  
  16. Now the truth!  HURKLE is not a game!  Under the conditions provided, you can 
  17. always win.
  18.  
  19. It is educational.  You can use it to demonstrate and practice the principles 
  20. of a binary search.  A binary search is a search in which you narrow the 
  21. search area by one half on each move.  It is called a binary search because 
  22. the number 2 is involved.  If the number of discrete locations to examine is 
  23. N, then for a K such that 2 raised to the Kth power is greater than N, then 
  24. the binary search can find the solution (object) in K guesses.
  25.  
  26. In particular, in this version of HURKLE, there are 15 possible hiding places 
  27. in each dimension.  Raising 2 to the 4th power gives 16, therefore, you can 
  28. find the hiding place in a minimum of 4 guesses.
  29.  
  30. How do you do that?  You divide and conquer.  Always guess 8,8 for the first 
  31. guess.  This divides each dimension in half.
  32.  
  33. Now suppose the hint is to GO SOUTHWEST.  This tells you that the HURKLE is 
  34. located someplace between X=1 and X=7, and Y=9 and Y=15.  So halve each of 
  35. those giving the next guess as 4,12.
  36.  
  37. Suppose the next hint is GO SOUTHEAST.  This tells you that the HURKLE is 
  38. someplace between X=5 and X=7, and Y=13 and Y=15.  Therefore you would find 
  39. the midpoint of these two ranges giving 6,14 as your next guess.
  40.  
  41. If the next hint is GO NORTHWEST, the only area that has not already been 
  42. eliminated is 5,13.  This must be the hiding place.
  43.  
  44. You may actually hit the hiding spot on fewer guesses, or you may get one of 
  45. the coordinates before the other one.  If you ever get a hint of a single 
  46. direction, that means you have already located one coordinate of the hiding 
  47. place.
  48.  
  49. Is this fun?  Or did I spoil it by making it too academic for you?
  50.  
  51. Now if you really want to cheat, read HURKLE3.DOC.
  52.